============== javascript learn script array structure topic, detailOrAns, grade ============== localStorage only supports strings. Use JSON.stringify() and JSON.parse(). localStorage.setItem(theRawList, JSON.stringify(theRawList)); storedNames = JSON.parse(localStorage.getItem("theRawList")); localStorage.learnList = JSON.stringify(theRawList); regainList = JSON.parse(localStorage.learnList); regainList[0][0] ============== backupList: future function displayStatus: count all g0, g1, ... g5 ============== showCard: increment showCount selectCardButton: showCardSelect: default: g0x1 +g1x0.9 +g2x0.8 +g3x0.7 +g4x0.6 +g5x0.5 +g6x0.4 pendingList = random g0x1 + ... + random g5x1 select 20 g0: select 20 g1: select 20 ... g6: select 20 ============== theRawList = [ ["this is a test", "explanation", 3], ["this is another test", "no explanation", 2], ["no more test", "no explanation", 1] ]; setupFlag = localStorage.setupflag; if (setupFlag !== "true"){ localStorage.learnList = JSON.stringify(theRawList); localStorage.setupflag = "true"; } regainList = JSON.parse(localStorage.learnList); === function storeList(regainList) { if(typeof(Storage) !== "undefined") { localStorage.learnList = JSON.stringify(theRawList); } } array in array ============== var itemList = [ [1, 2], [3, 4], [5, 6] ]; console.log(itemList[0][0]); // 1 console.log(itemList); === var itemList = new Array(10); for (var i = 0; i < 10; i++) { itemList[i] = new Array(20); } itemList[5][12] = 3.0; === var itemList = [[]]; === function matrix( rows, cols, defaultValue){ var itemList = []; // Creates all lines: for(var i=0; i < rows; i++){ itemList.push([]); // Creates an empty line itemList[i].push( new Array(cols)); // Adds cols to the empty line for(var j=0; j < cols; j++){ itemList[i][j] = defaultValue; // Initializes } } return itemList; } usage examples: x = matrix( 2 , 3,''); // 2 lines, 3 cols filled with empty string y = matrix( 10, 5, 0);// 10 lines, 5 cols filled with 0 array of objects ================ var array = []; array.push({ name: 'abc', value: 'def' }); array.push({ name: 'ghi', value: 'jkl' }); for (var i = 0; i < array.length; i++) { // use array[i] here } ================ $.get("textFile.txt", function(data) { var items = data.split(','); }); ================ ============== var srcFrame; function loadOuter(doc) { srcFrame = document.getElementById("hiddenContent"); srcFrame.src = doc; // workaround for missing onLoad event in IFRAME for NN6 if (!srcFrame.onload) { setTimeout("transferHTML()", 1000) } } function transferHTML(){ srcContent=''; if (srcFrame.contentDocument){ srcContent=srcFrame.contentDocument.getElementsByTagName("BODY")[0].innerHTML; } else if (srcFrame.contentWindow){ srcContent=srcFrame.contentWindow.document.body.innerHTML; } document.getElementById("outerDisplay").innerHTML = srcContent }
============== https://social.msdn.microsoft.com/Forums/en-US/64ea2d16-7594-400b-8b25-8b3b9a078eab/read-external-text-file-with-javascript?forum=sidebargadfetdevelopment This code should help you read from a remote text file: Code Snippet var txtFile = new XMLHttpRequest(); txtFile.open("GET", "http://my.remote.url/myremotefile.txt", true); txtFile.onreadystatechange = function() { if (txtFile.readyState === 4) { // Makes sure the document is ready to parse. if (txtFile.status === 200) { // Makes sure it's found the file. allText = txtFile.responseText; lines = txtFile.responseText.split("\n"); // Will separate each line into an array } } } txtFile.send(null); you can use a local file, just use the file:// protocol (ie file://C:/Users/Andy/Documents/textfile.txt). ==============